﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpDevService.h"
#include "OwnerPtr.h"
#include "GcmpApiDeclaration.h"

namespace gcmp
{
    /// \brief 应用程序级配置用户偏好
    class GCMP_DEV_SERVICE_EXPORT IOpenedFileRecords
    {
    public:
        /// \brief 获取Gcmp应用程序级用户配置用户偏好
        static IOpenedFileRecords* Get();



        // 载入用户选项配置
        virtual bool Load() = 0;
        // 保存用户选项配置
        virtual bool Save() = 0;

        //Document 打开成功添加当前文档名称
        virtual void AddOpenedFile(const std::wstring & fullpath) = 0;

        //Document 打开成功添加当前文档名称
        virtual void RemoveOpenedFile(const std::wstring & fullpath) = 0;

        //清理所有打开文档记录
        virtual void Clear() = 0;

        //根据bak，获取打开过的文件
        virtual void GetOpenedFiles(std::list<std::wstring>& files) = 0;

        //仅保存打开文档记录
        //读取当前已存UserOptions，仅更新打开文档记录
        virtual bool SaveOpenFileRecords() = 0;

    public:
        /// \brief 析构函数
        virtual ~IOpenedFileRecords() {}
    };
}//namespace gcmp


